LabVIEW FPGA Waveform Acquisition and Logging on CompactRIO

LabVIEW 2013

The LabVIEW FPGA Waveform Acquisition and Logging on CompactRIO sample project acquires continuous waveform data and logs it to disk on the real-time controller. The acquisition code, which was created with the LabVIEW FPGA Module, runs on the FPGA inside the CompactRIO device.

This sample project is based on the Simple State Machine and Queued Message Handler templates. Refer to the Simple State Machine and Queued Message Handler templates and their documentation, available from the Create Project dialog box, for information about how these templates work.

Features

Developer Walkthrough

Refer to ni.com for a developer walkthrough of the LabVIEW Real-Time sample projects.

System Requirements

Development System

NI CompactRIO Device in FPGA Interface Mode

This sample project is designed for an NI cRIO-9074 with the following components:

Overview

This sample project consists of nine parallel loops across three execution targets. The following loops run in parallel on the desktop computer:

The following loops run in parallel on the real-time controller:

The following loop runs on the FPGA:

Running this Sample Project

  1. Adapt the sample project to your hardware.
  2. In the Project Explorer window, open My Computer»Utility - Configuration File Generator.vi.
  3. Enter the configuration values that are appropriate for your application. Be sure to look at all the values in the TDMS Properties array.
  4. Run the VI. LabVIEW generates a configuration file, Config.xml in the same directory as the .lvproj file.
  5. Transfer this XML file to the root folder of the real-time controller.
  6. Run RT CompactRIO Target»RT Main.vi. This VI begins acquiring data and logging it using the configuration settings in Config.xml.
  7. Open and run My Computer»UI Main.vi.
  8. Enter the IP address of the CompactRIO device in the Controller Address text box and click Connect.
  9. After you are connected, display live data in the waveform chart by clicking Acquire Live Data. Change the Live Data Channel control to see live data from different channels.
  10. Click Exit to exit the application.

Adapting this Sample Project to Your Hardware

The FPGA VI in this sample project is compiled for specific FPGA and I/O hardware. If you have a different FPGA or different C Series modules, you must adapt this sample project to your hardware. The following steps refer to NI CompactRIO devices, but you also can adapt this sample project to an NI Single-Board RIO device.

  1. Ensure all devices are configured and connected to the same network as the development computer.
  2. In the Project Explorer window, add or discover your RT CompactRIO target to the top-level project item.
  3. Add or discover your CompactRIO chassis to the RT Compact RIO target you added in the previous step. Ensure the chassis is set to LabVIEW FPGA Interface mode.
  4. Add or discover your FPGA target to the CompactRIO chassis you added in the previous step. When prompted to deploy settings, click Deploy Later.
  5. Add or discover your C Series input module to the FPGA target you added in the previous step.
  6. Drag the following project items from the default RT CompactRIO target to the one you added in step 2:
  7. Drag the following project items from the default FPGA target to the one you added in step 4:
  8. Delete the default RT CompactRIO Target project item that no longer has any VIs associated with it.
  9. Re-establish the link between RT Main.vi and the bitfile:
    1. Open Start Acquisition and Logging.vi, located in the Support VIs folder on the RT CompactRIO Target.
    2. Drag FPGA Main.vi from the Project Explorer window to the Open FPGA VI Reference VI function.
  10. Open FPGA Main.vi and ensure the FPGA I/O Node uses the input channels you want. For example, you may want the FPGA I/O Node to read from Mod2/AI5 instead of Mod1/AI2. The actual channels you read from depend on your application.

    By default, the FPGA I/O Node in this VI reads from Mod1/AI0–3.

You now can compile the FPGA VI and run it as part of your application.

Configuring Sample Project Settings

In the Project Explorer window, open My Computer»Globals»Global - Configuration Options.vi and configure the sample project settings.

LabVIEW Features and Concepts Used


Important Information

Copyright

© 2013 National Instruments Corporation. All rights reserved.

Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.

National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.

End-User License Agreements and Third-Party Legal Notices

You can find end-user license agreements (EULAs) and third-party legal notices in the following locations after installation:

Trademarks

Refer to the NI Trademarks and Logo Guidelines at ni.com/trademarks for information on National Instruments trademarks. Other product and company names mentioned herein are trademarks or trade names of their respective companies.

Patents

For patents covering the National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents.